package MyByteStream1;

import java.io.FileOutputStream;
import java.io.IOException;

public class MyByteStreamDemo2 {
    public static void main(String[] args) throws IOException {
        /*
        * void write(int b)
        * void write(byte[]b)
        * void write(byte[]b,int off,int len)
        * //参数1：数组
        //参数2：起始索引
        //参数3：个数
        *
        *
        * */
        //创建对象
        FileOutputStream fos = new FileOutputStream
                ("D:\\File\\csb.txt");
        //写出数据
        byte[]bytes = {97,98,99,100,101};
        //fos.write(bytes);
        fos.write(bytes,1,2);
        //关闭资源
        fos.close();


    }
}
